LOCAL_PATH := $(call my-dir)

# feature_comparison
include $(CLEAR_VARS)
include ${OPENCV_PACKAGE_DIR}/share/OpenCV/OpenCV.mk
NEAR_C_INCLUDES := $(LOCAL_C_INCLUDES)
NEAR_STATIC_LIBRARIES := $(LOCAL_STATIC_LIBRARIES)
NEAR_CFLAGS := $(LOCAL_CFLAGS)

OPENCV_CAMERA_MODULES:=off

LOCAL_MODULE    := feature_comparison
LOCAL_SRC_FILES := src/feature_comp.cpp
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)

# precomp
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(NEAR_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := $(NEAR_STATIC_LIBRARIES)
LOCAL_CFLAGS := $(NEAR_CFLAGS)
OPENCV_CAMERA_MODULES:=off

LOCAL_MODULE    := precomp
LOCAL_SRC_FILES := src/precomp.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)

# util
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(NEAR_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := $(NEAR_STATIC_LIBRARIES)
LOCAL_CFLAGS := $(NEAR_CFLAGS)
OPENCV_CAMERA_MODULES:=off

LOCAL_MODULE    := util
LOCAL_SRC_FILES := src/util.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_SHARED_LIBRARIES += precomp
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)

# matchers
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(NEAR_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := $(NEAR_STATIC_LIBRARIES)
LOCAL_CFLAGS := $(NEAR_CFLAGS)
OPENCV_CAMERA_MODULES:=off

LOCAL_MODULE    := matchers
LOCAL_SRC_FILES := src/matchers.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_SHARED_LIBRARIES += util precomp
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)

# autocalib
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(NEAR_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := $(NEAR_STATIC_LIBRARIES)
LOCAL_CFLAGS := $(NEAR_CFLAGS)
OPENCV_CAMERA_MODULES:=off

LOCAL_MODULE    := autocalib
LOCAL_SRC_FILES := src/autocalib.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_SHARED_LIBRARIES += util precomp matchers
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)

# blenders
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(NEAR_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := $(NEAR_STATIC_LIBRARIES)
LOCAL_CFLAGS := $(NEAR_CFLAGS)
OPENCV_CAMERA_MODULES:=off

LOCAL_MODULE    := blenders
LOCAL_SRC_FILES := src/blenders.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_SHARED_LIBRARIES += util precomp
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)

# exposure compensate
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(NEAR_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := $(NEAR_STATIC_LIBRARIES)
LOCAL_CFLAGS := $(NEAR_CFLAGS)
OPENCV_CAMERA_MODULES:=off

LOCAL_MODULE    := exposure_compensate
LOCAL_SRC_FILES := src/exposure_compensate.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_SHARED_LIBRARIES += util precomp
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)

# motion estimators
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(NEAR_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := $(NEAR_STATIC_LIBRARIES)
LOCAL_CFLAGS := $(NEAR_CFLAGS)
OPENCV_CAMERA_MODULES:=off

LOCAL_MODULE    := motion_estimators
LOCAL_SRC_FILES := src/motion_estimators.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_SHARED_LIBRARIES += util precomp matchers autocalib
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)

# seam finders
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(NEAR_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := $(NEAR_STATIC_LIBRARIES)
LOCAL_CFLAGS := $(NEAR_CFLAGS)
OPENCV_CAMERA_MODULES:=off

LOCAL_MODULE    := seam_finders
LOCAL_SRC_FILES := src/seam_finders.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_SHARED_LIBRARIES += util precomp
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)

# warpers
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(NEAR_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := $(NEAR_STATIC_LIBRARIES)
LOCAL_CFLAGS := $(NEAR_CFLAGS)
OPENCV_CAMERA_MODULES:=off

LOCAL_MODULE    := warpers
LOCAL_SRC_FILES := src/warpers.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_SHARED_LIBRARIES += util precomp
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)

# opencv stitcher
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(NEAR_C_INCLUDES)
LOCAL_STATIC_LIBRARIES := $(NEAR_STATIC_LIBRARIES)
LOCAL_CFLAGS := $(NEAR_CFLAGS)
OPENCV_CAMERA_MODULES:=off

LOCAL_MODULE    := opencv_stitcher
LOCAL_SRC_FILES := src/opencv_stitching.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_SHARED_LIBRARIES += util precomp warpers blenders seam_finders motion_estimators exposure_compensate matchers
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)
